var RECEIPT_TOOLBAR = {
	FRONT: Math.pow(2, 0),
	NEXT: Math.pow(2, 1),
	ADD: Math.pow(2, 2),
	SAVE: Math.pow(2, 3),
	DELETE: Math.pow(2, 4),
	VERIFY: Math.pow(2, 5),
	UNVERIFY: Math.pow(2, 6),
	SEARCH: Math.pow(2, 7),
	PRINT: Math.pow(2, 8),
	CHARGE: Math.pow(2, 9),
	EXPORT: Math.pow(2, 10),
	SEARCHALL: Math.pow(2, 11),
};
var toolbarData = [{
	"icon": "icon-left",
	"id": "btn_front",
	"functionname": "上张"
}, {
	"icon": "icon-right",
	"id": "btn_next",
	"functionname": "下张"
}, {
	"icon": "icon-add",
	"id": "btn_add",
	"functionname": "新建单据"
}, {
	"icon": "icon-save",
	"id": "btn_save",
	"functionname": "保存单据"
}, {
	"icon": "icon-remove",
	"id": "btn_remove",
	"functionname": "删除单据"
}, {
	"icon": "icon-to_do",
	"id": "btn_verify",
	"functionname": "审核单据"
}, {
	"icon": "icon-redo",
	"id": "btn_unverify",
	"functionname": "弃审单据"
}, {
	"icon": "icon-search",
	"id": "btn_search",
	"functionname": "查询"
}, {
	"icon": "icon-print",
	"id": "btn_print",
	"functionname": "打印单据"
}, {
	"icon": "icon-usermanagement",
	"id": "btn_fee",
	"functionname": "收费"
}, {
	"icon": "icon-save",
	"id": "btn_load",
	"functionname": "导出"
}, {
	"icon": "icon-undo",
	"id": "btn_undo",
	"functionname": "查看所有数据"
}];

function ReceiptsToolBar(type, newdata) {
	if(!type) {
		throw new Error("不能没有生成参数");
	} else {
		this.type = type;
	}
	if(newdata) {
		this.newdata = newdata;
	}
	this.processHtml = function() {
		var content = "";
		var s;
		////////////////
		for(var i = 0; i < toolbarData.length; i++) {
			s = this.type & (1 << i);
			if(s != 0) {
				content += "<a href=\"javascript:void(0)\" class=\"easyui-linkbutton\" id=\"" + toolbarData[i].id + "\" iconCls=\"" + toolbarData[i].icon + "\" plain=\"true\" >" + toolbarData[i].functionname + "</a>";
			}
		}
		if(this.newdata) {
			for(var i = 0; i < this.newdata.length; i++) {
				content += "<a href=\"javascript:void(0)\" class=\"easyui-linkbutton\" id=\"" + this.newdata[i].id + "\" iconCls=\"" + this.newdata[i].icon + "\" plain=\"true\" >" + this.newdata[i].functionname + "</a>";
			}
		}
		return content;
	};
	
}